// 用户端 - 路由
'use strict';

module.exports = app => {
  const { router, controller } = app;
  router.post('/tube/user/register', controller.cUser.wa_c_register);
  router.post('/tube/user/login', controller.cUser.wa_c_login);
  router.get('/tube/user/queryUsers', controller.cUser.wa_c_query);
  router.put('/tube/user/updateUsers', controller.cUser.wa_c_update);
  router.delete('/tube/user/deleteUsers', controller.cUser.wa_c_delete);
  //用户余额查询
  router.get('/tube/user/queryUserBalance', controller.cUser.wa_c_getUserBalance);

  //Web端用户购物车查询
  router.get('/tube/admin/queryUsersCart', controller.cUser.pc_c_query_cart);
  //Web端用户购物车更新
  router.put('/tube/admin/updateUsersCart', controller.cUser.pc_c_update_cart);

  //用户地址查询
  router.get('/tube/user/queryUsersAddress', controller.cUser.wa_c_query_address);
  //用户地址新增
  router.post('/tube/user/createUsersAddress', controller.cUser.wa_c_create_address);
  //设置用户默认地址
  router.post('/tube/user/setdefaultAddress', controller.cUser.wa_c_setdefault_address);
  //用户地址修改
  router.put('/tube/user/updateUsersAddress', controller.cUser.wa_c_update_address);
  //用户地址删除
  router.delete('/tube/user/deleteUsersAddress', controller.cUser.wa_c_delete_address);

}